package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Exam;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface ExamMapper extends BaseMapper<Exam> {
    List<Exam> findAll();
    Exam findById(@Param("exam_id") Long eid);
    List<Exam> findByStudentId(@Param("student_id") Long sid);

    //exam_id,licence_id,student_id,subject_id,app_time,exam_time,exam_score
    void updateExam(@Param("exam_id")Long eid,
                    @Param("licence_id") Long lid,
                    @Param("student_id")Long studentId,
                    @Param("subject_id")Long subjectId,
                    @Param("app_time") java.sql.Date appTime,
                    @Param("exam_time") Date examTime,
                    @Param("exam_score")String examScore);
    void updateScore(@Param("exam_id")Long eid,@Param("exam_score") String score);
    void insertExam(@Param("exam_id")Long eid,
                    @Param("licence_id") Long lid,
                    @Param("student_id")Long studentId,
                    @Param("subject_id")Long subjectId,
                    @Param("app_time") java.sql.Date appTime,
                    @Param("exam_time") java.sql.Date examTime,
                    @Param("exam_score")String examScore);
     List<Exam> filterExam(@Param("student_name")String studentName,
                           @Param("student_identity_id") String identityId,
                           @Param("licence_id") Long licenceId,
                           @Param("subject_id") Long subjectId,
                           @Param("exam_time") java.sql.Date examTime);
}
